<?php

namespace App\model;

use Illuminate\Database\Eloquent\Model;

/**
 * App\model\User
 *
 * @property int $id
 * @property string|null $name
 * @property string|null $email
 * @property string|null $password
 * @property string|null $remember_token
 * @property \Illuminate\Support\Carbon|null $created_at
 * @property \Illuminate\Support\Carbon|null $updated_at
 * @property int|null $mobile 手机号
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\User whereCreatedAt($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\User whereEmail($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\User whereId($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\User whereMobile($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\User whereName($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\User wherePassword($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\User whereRememberToken($value)
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\User whereUpdatedAt($value)
 * @mixin \Eloquent
 * @property float|null $reward 奖励金额
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\User whereReward($value)
 * @property string|null $type 来源
 * @method static \Illuminate\Database\Eloquent\Builder|\App\model\User whereType($value)
 */
class User extends Model
{
    //
    protected $table="users";

    public static function getSelectOptions()
    {
        $options = \DB::table('users')->select('id','name as text')->get();
        $selectOption = [];
        foreach ($options as $option){
            $selectOption[$option->id] = $option->text;
        }
        return $selectOption;
    }
}
